package com.atguigu.gmall.payment.service;

import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.model.payment.PaymentInfo;

import java.util.HashMap;

/**
 * @Author atguigu-mqx
 * @Description TODO
 * @Date 2023/5/27 15:14
 * @Version 1.0
 */
public interface PaymentService {
    /**
     * 保存交易记录
     * @param orderInfo
     * @param paymentType
     */
    void savePaymentInfo(OrderInfo orderInfo,String paymentType);

    /**
     * 更新交易记录状态
     * @param outTradeNo
     * @param paymentType
     * @param paramsMap
     */
    void updatePaymentStatus(String outTradeNo, String paymentType, HashMap<String, String> paramsMap);

    /**
     * 查询交易记录
     * @param outTradeNo
     * @param paymentType
     * @return
     */
    PaymentInfo getPaymentInfo(String outTradeNo, String paymentType);

    /**
     * 修改交易记录状态
     * @param paymentInfo
     * @param outTradeNo
     * @param paymentType
     */
    void updatePaymentStatus(PaymentInfo paymentInfo, String outTradeNo, String paymentType);

    /**
     * 根据订单Id 关闭交易记录.
     * @param orderId
     */
    void paymentClose(Long orderId);
}
